package com.ruoyi.depot.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 出库单对象 tb_outbound_order
 * 
 * @author lxy
 * @date 2025-06-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OutboundOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 出库单ID */
    private Long outboundId;

    /** 出库单号 */
    @Excel(name = "出库单号")
    private String outboundNo;

    /** 仓库ID */
    @Excel(name = "仓库ID")
    private Integer warehouseId;

    /** 仓库名称 */
    @Excel(name = "仓库名称")
    private String warehouseName;

    /** 出库类型(01:销售出库,02:调拨出库,03:其他出库) */
    @Excel(name = "出库类型(01:销售出库,02:调拨出库,03:其他出库)")
    private Integer outboundType;

    /** 出库日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出库日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date outboundDate;

    /** 关联单据号 */
    @Excel(name = "关联单据号")
    private String relatedOrderNo;

    /** 客户ID */
    @Excel(name = "客户ID")
    private Long customerId;

    /** 收货人 */
    @Excel(name = "收货人")
    private String receiverName;

    /** 收货电话 */
    @Excel(name = "收货电话")
    private String receiverPhone;

    /** 收货地址 */
    @Excel(name = "收货地址")
    private String receiverAddress;

    /** 出库总数量 */
    @Excel(name = "出库总数量")
    private Integer totalQuantity;

    /** 出库总金额 */
    @Excel(name = "出库总金额")
    private BigDecimal totalAmount;

    /** 状态 */
    @Excel(name = "状态")
    private Integer status;

    /** 审核人 */
    @Excel(name = "审核人")
    private String approver;

    /** 审核时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date approveTime;

    /** 创建人 */
    @Excel(name = "创建人")
    private String creator;

    /** 更新人 */
    @Excel(name = "更新人")
    private String updater;

    /** 删除状态(0:正常,1:已删除) */
    @Excel(name = "删除状态(0:正常,1:已删除)")
    private String deleteStatus;

    private List<OutboundOrderDetail> detailList;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("outboundId", getOutboundId())
            .append("outboundNo", getOutboundNo())
            .append("warehouseId", getWarehouseId())
            .append("outboundType", getOutboundType())
            .append("outboundDate", getOutboundDate())
            .append("relatedOrderNo", getRelatedOrderNo())
            .append("customerId", getCustomerId())
            .append("receiverName", getReceiverName())
            .append("receiverPhone", getReceiverPhone())
            .append("receiverAddress", getReceiverAddress())
            .append("totalQuantity", getTotalQuantity())
            .append("totalAmount", getTotalAmount())
            .append("status", getStatus())
            .append("remark", getRemark())
            .append("approver", getApprover())
            .append("approveTime", getApproveTime())
            .append("creator", getCreator())
            .append("createTime", getCreateTime())
            .append("updater", getUpdater())
            .append("updateTime", getUpdateTime())
            .append("deleteStatus", getDeleteStatus())
            .toString();
    }
}
